using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sysgeprava.Entities;

namespace Sysgeprava.Repository.Mapping
{
    public class FOTO_BOVINOMap : EntityTypeConfiguration<FOTO_BOVINO>
    {
        public FOTO_BOVINOMap()
        {
            // Primary Key
            this.HasKey(t => t.IdBovino);

            // Properties
            this.Property(t => t.IdBovino)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("FOTO_BOVINO");
            this.Property(t => t.IdBovino).HasColumnName("IdBovino");
            this.Property(t => t.Imagen).HasColumnName("Imagen");
            this.Property(t => t.Hash).HasColumnName("Hash");

            // Relationships
            this.HasRequired(t => t.BOVINO)
                .WithOptional(t => t.FOTO_BOVINO);

        }
    }
}
